package com.horse.cloud.pay;

import com.horse.cloud.pay.core.AbstractPayFactory;
import com.horse.cloud.pay.core.AbstractPayment;
import com.horse.cloud.pay.core.PayFactoryProducer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @create: Created by intelliJ IDEA18.1.3
 * @author: bing.Pan
 * @e-mail: 15923508369@163.com
 * @gmdate: 29/04/2019　14:20　星期一 (dd/MM/YYYY HH:mm)
 * @sidesc:
 */

@RestController
@RequestMapping(value = "/totPay")
public class TOTPay {


    @PostMapping(value = "/test")
    public void totPay(){

        try {
            AbstractPayFactory abstractPayFactory = PayFactoryProducer.payFactory("aliPayFactory");
            AbstractPayment payment = abstractPayFactory.getPayment("aliPayService");
            payment.pay();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
